<!DOCTYPE html>
<html lang="en">
  <head>
    <title>CentralManager Class Reference</title>
    <link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
    <link rel="stylesheet" type="text/css" href="../css/highlight.css" />
    <meta charset='utf-8'>
    <script src="../js/jquery.min.js" defer></script>
    <script src="../js/jazzy.js" defer></script>
    
    <script src="../js/lunr.min.js" defer></script>
    <script src="../js/typeahead.jquery.js" defer></script>
    <script src="../js/jazzy.search.js" defer></script>
  </head>
  <body>
    <a name="//apple_ref/swift/Class/CentralManager" class="dashAnchor"></a>
    <a title="CentralManager Class Reference"></a>
    <header>
      <div class="content-wrapper">
        <p><a href="../index.html">RxBluetoothKit 6.0.0 Docs</a> (82% documented)</p>
        <p class="header-right"><a href="https://github.com/Polidea/RxBluetoothKit"><img src="../img/gh.png"/>View on GitHub</a></p>
        <p class="header-right">
          <form role="search" action="../search.json">
            <input type="text" placeholder="Search documentation" data-typeahead>
          </form>
        </p>
      </div>
    </header>
    <div class="content-wrapper">
      <p id="breadcrumbs">
        <a href="../index.html">RxBluetoothKit Reference</a>
        <img id="carat" src="../img/carat.png" />
        CentralManager Class Reference
      </p>
    </div>
    <div class="content-wrapper">
      <nav class="sidebar">
        <ul class="nav-groups">
          <li class="nav-group-name">
            <a href="../Classes.html">Classes</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Classes/CentralManager.html">CentralManager</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/Characteristic.html">Characteristic</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/Descriptor.html">Descriptor</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/Peripheral.html">Peripheral</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/PeripheralManager.html">PeripheralManager</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/RxBluetoothKitLog.html">RxBluetoothKitLog</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/RxBluetoothKitLog/LogLevel.html">– LogLevel</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/ScannedPeripheral.html">ScannedPeripheral</a>
              </li>
              <li class="nav-group-task">
                <a href="../Classes/Service.html">Service</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Enums.html">Enumerations</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Enums/BluetoothError.html">BluetoothError</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/BluetoothState.html">BluetoothState</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/RxBluetoothKitLogger.html">RxBluetoothKitLogger</a>
              </li>
              <li class="nav-group-task">
                <a href="../Enums/StartAdvertisingResult.html">StartAdvertisingResult</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Extensions.html">Extensions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Extensions/Reactive.html">Reactive</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Functions.html">Functions</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Functions.html#/s:14RxBluetoothKit2eeoiySbAA0B5ErrorO_ADtF">==(_:_:)</a>
              </li>
              <li class="nav-group-task">
                <a href="../Functions.html#/s:14RxBluetoothKit2eeoiySbAA10DescriptorC_ADtF">==(_:_:)</a>
              </li>
              <li class="nav-group-task">
                <a href="../Functions.html#/s:14RxBluetoothKit2eeoiySbAA10PeripheralC_ADtF">==(_:_:)</a>
              </li>
              <li class="nav-group-task">
                <a href="../Functions.html#/s:14RxBluetoothKit2eeoiySbAA14CharacteristicC_ADtF">==(_:_:)</a>
              </li>
              <li class="nav-group-task">
                <a href="../Functions.html#/s:14RxBluetoothKit2eeoiySbAA7ServiceC_ADtF">==(_:_:)</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Protocols.html">Protocols</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Protocols/CharacteristicIdentifier.html">CharacteristicIdentifier</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/DescriptorIdentifier.html">DescriptorIdentifier</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/Logger.html">Logger</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/ManagerType.html">ManagerType</a>
              </li>
              <li class="nav-group-task">
                <a href="../Protocols/ServiceIdentifier.html">ServiceIdentifier</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Structs.html">Structures</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Structs/AdvertisementData.html">AdvertisementData</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/CentralManagerRestoredState.html">CentralManagerRestoredState</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/PeripheralManagerRestoredState.html">PeripheralManagerRestoredState</a>
              </li>
              <li class="nav-group-task">
                <a href="../Structs/RestoredState.html">RestoredState</a>
              </li>
            </ul>
          </li>
          <li class="nav-group-name">
            <a href="../Typealiases.html">Type Aliases</a>
            <ul class="nav-group-tasks">
              <li class="nav-group-task">
                <a href="../Typealiases.html#/s:14RxBluetoothKit19DisconnectionReasona">DisconnectionReason</a>
              </li>
              <li class="nav-group-task">
                <a href="../Typealiases.html#/s:14RxBluetoothKit32OnWillRestoreCentralManagerStatea">OnWillRestoreCentralManagerState</a>
              </li>
              <li class="nav-group-task">
                <a href="../Typealiases.html#/s:14RxBluetoothKit35OnWillRestorePeripheralManagerStatea">OnWillRestorePeripheralManagerState</a>
              </li>
              <li class="nav-group-task">
                <a href="../Typealiases.html#/s:14RxBluetoothKit18OnWillRestoreStatea">OnWillRestoreState</a>
              </li>
              <li class="nav-group-task">
                <a href="../Typealiases.html#/s:14RxBluetoothKit25RestoredAdvertisementDataa">RestoredAdvertisementData</a>
              </li>
            </ul>
          </li>
        </ul>
      </nav>
      <article class="main-content">
        <section>
          <section class="section">
            <h1>CentralManager</h1>
              <div class="declaration">
                <div class="language">
                  
                  <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">class</span> <span class="kt">CentralManager</span> <span class="p">:</span> <span class="kt"><a href="../Protocols/ManagerType.html">ManagerType</a></span></code></pre>

                </div>
              </div>
            <p>CentralManager is a class implementing ReactiveX API which wraps all Core Bluetooth Manager&rsquo;s functions allowing to
discover, connect to remote peripheral devices and more.
You can start using this class by discovering available services of nearby peripherals. Before calling any
public <code>CentralManager</code>&lsquo;s functions you should make sure that Bluetooth is turned on and powered on.
It can be done by calling and observing returned value of <code>observeStateWithInitialValue()</code> and then
chaining it with <code>scanForPeripherals(_:options:)</code>:</p>
<pre class="highlight swift"><code><span class="k">let</span> <span class="nv">disposable</span> <span class="o">=</span> <span class="n">centralManager</span><span class="o">.</span><span class="nf">observeStateWithInitialValue</span><span class="p">()</span>
    <span class="o">.</span><span class="n">filter</span> <span class="p">{</span> <span class="nv">$0</span> <span class="o">==</span> <span class="o">.</span><span class="n">poweredOn</span> <span class="p">}</span>
    <span class="o">.</span><span class="nf">take</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
    <span class="o">.</span><span class="n">flatMap</span> <span class="p">{</span> <span class="n">centralManager</span><span class="o">.</span><span class="nf">scanForPeripherals</span><span class="p">(</span><span class="kc">nil</span><span class="p">)</span> <span class="p">}</span>
</code></pre>

<p>As a result you will receive <code><a href="../Classes/ScannedPeripheral.html">ScannedPeripheral</a></code> which contains <code><a href="../Classes/Peripheral.html">Peripheral</a></code> object, <code><a href="../Structs/AdvertisementData.html">AdvertisementData</a></code> and
peripheral&rsquo;s RSSI registered during discovery. You can then <code>establishConnection(_:options:)</code> and do other operations.
You can also simply stop scanning with just disposing it:</p>
<pre class="highlight swift"><code><span class="n">disposable</span><span class="o">.</span><span class="nf">dispose</span><span class="p">()</span>
</code></pre>
<div class="aside aside-seealso">
    <p class="aside-title">Seealso</p>
    <code><a href="../Classes/Peripheral.html">Peripheral</a></code>

</div>

              <div class="slightly-smaller">
                <a href="https://github.com/Polidea/RxBluetoothKit/tree/6.0.0/Source/CentralManager.swift#L27-L342">Show on GitHub</a>
              </div>
          </section>
          <section class="section task-group-section">
            <div class="task-group">
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14RxBluetoothKit14CentralManagerC7managerSo09CBCentralE0Cvp"></a>
                    <a name="//apple_ref/swift/Property/manager" class="dashAnchor"></a>
                    <a class="token" href="#/s:14RxBluetoothKit14CentralManagerC7managerSo09CBCentralE0Cvp">manager</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Implementation of CBCentralManager</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">let</span> <span class="nv">manager</span><span class="p">:</span> <span class="kt">CBCentralManager</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/Polidea/RxBluetoothKit/tree/6.0.0/Source/CentralManager.swift#L30">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14RxBluetoothKit14CentralManagerC07centralE0So09CBCentralE0Cvp"></a>
                    <a name="//apple_ref/swift/Property/centralManager" class="dashAnchor"></a>
                    <a class="token" href="#/s:14RxBluetoothKit14CentralManagerC07centralE0So09CBCentralE0Cvp">centralManager</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Undocumented</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">centralManager</span><span class="p">:</span> <span class="kt">CBCentralManager</span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/Polidea/RxBluetoothKit/tree/6.0.0/Source/CentralManager.swift#L">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Initialization"></a>
                <a name="//apple_ref/swift/Section/Initialization" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Initialization"></a>
                  <h3 class="section-name"><p>Initialization</p>
</h3>
                </div>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14RxBluetoothKit14CentralManagerC5queue7optionsACSo012OS_dispatch_F0C_SDySSyXlGSgtcfc"></a>
                    <a name="//apple_ref/swift/Method/init(queue:options:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:14RxBluetoothKit14CentralManagerC5queue7optionsACSo012OS_dispatch_F0C_SDySSyXlGSgtcfc">init(queue:<wbr>options:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Creates new <code>CentralManager</code> instance. By default all operations and events are executed and received on main thread.</p>
<div class="aside aside-warning">
    <p class="aside-title">Warning</p>
    If you pass background queue to the method make sure to observe results on main thread for UI related code.

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="n">convenience</span> <span class="nf">init</span><span class="p">(</span><span class="nv">queue</span><span class="p">:</span> <span class="kt">DispatchQueue</span> <span class="o">=</span> <span class="o">.</span><span class="n">main</span><span class="p">,</span>
                        <span class="nv">options</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span><span class="p">:</span> <span class="kt">AnyObject</span><span class="p">]?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>queue</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Queue on which bluetooth callbacks are received. By default main thread is used.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>options</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>An optional dictionary containing initialization options for a central manager.
For more info about it please refer to <a href="https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBCentralManager_Class/index.html">Central Manager initialization options</a></p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/Polidea/RxBluetoothKit/tree/6.0.0/Source/CentralManager.swift#L73-L83">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14RxBluetoothKit14CentralManagerC6attachyyF"></a>
                    <a name="//apple_ref/swift/Method/attach()" class="dashAnchor"></a>
                    <a class="token" href="#/s:14RxBluetoothKit14CentralManagerC6attachyyF">attach()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Attaches RxBluetoothKit delegate to CBCentralManager.
This method is useful in cases when delegate of CBCentralManager was reassigned outside of
RxBluetoothKit library (e.g. CBCentralManager was used in some other library or used in non-reactive way)</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">attach</span><span class="p">()</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/Polidea/RxBluetoothKit/tree/6.0.0/Source/CentralManager.swift#L88-L90">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/State"></a>
                <a name="//apple_ref/swift/Section/State" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/State"></a>
                  <h3 class="section-name"><p>State</p>
</h3>
                </div>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14RxBluetoothKit11ManagerTypeP5stateAA0B5StateOvp"></a>
                    <a name="//apple_ref/swift/Property/state" class="dashAnchor"></a>
                    <a class="token" href="#/s:14RxBluetoothKit11ManagerTypeP5stateAA0B5StateOvp">state</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">state</span><span class="p">:</span> <span class="kt"><a href="../Enums/BluetoothState.html">BluetoothState</a></span> <span class="p">{</span> <span class="k">get</span> <span class="p">}</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/Polidea/RxBluetoothKit/tree/6.0.0/Source/CentralManager.swift#L94-L96">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14RxBluetoothKit11ManagerTypeP12observeState0A5Swift10ObservableCyAA0bG0OGyF"></a>
                    <a name="//apple_ref/swift/Method/observeState()" class="dashAnchor"></a>
                    <a class="token" href="#/s:14RxBluetoothKit11ManagerTypeP12observeState0A5Swift10ObservableCyAA0bG0OGyF">observeState()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">observeState</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">Observable</span><span class="o">&lt;</span><span class="kt"><a href="../Enums/BluetoothState.html">BluetoothState</a></span><span class="o">&gt;</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/Polidea/RxBluetoothKit/tree/6.0.0/Source/CentralManager.swift#L98-L100">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14RxBluetoothKit11ManagerTypeP28observeStateWithInitialValue0A5Swift10ObservableCyAA0bG0OGyF"></a>
                    <a name="//apple_ref/swift/Method/observeStateWithInitialValue()" class="dashAnchor"></a>
                    <a class="token" href="#/s:14RxBluetoothKit11ManagerTypeP28observeStateWithInitialValue0A5Swift10ObservableCyAA0bG0OGyF">observeStateWithInitialValue()</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        
                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">observeStateWithInitialValue</span><span class="p">()</span> <span class="o">-&gt;</span> <span class="kt">Observable</span><span class="o">&lt;</span><span class="kt"><a href="../Enums/BluetoothState.html">BluetoothState</a></span><span class="o">&gt;</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/Polidea/RxBluetoothKit/tree/6.0.0/Source/CentralManager.swift#L102-L112">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Scanning"></a>
                <a name="//apple_ref/swift/Section/Scanning" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Scanning"></a>
                  <h3 class="section-name"><p>Scanning</p>
</h3>
                </div>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14RxBluetoothKit14CentralManagerC18scanForPeripherals12withServices7options0A5Swift10ObservableCyAA17ScannedPeripheralCGSaySo6CBUUIDCGSg_SDySSypGSgtF"></a>
                    <a name="//apple_ref/swift/Method/scanForPeripherals(withServices:options:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:14RxBluetoothKit14CentralManagerC18scanForPeripherals12withServices7options0A5Swift10ObservableCyAA17ScannedPeripheralCGSaySo6CBUUIDCGSg_SDySSypGSgtF">scanForPeripherals(withServices:<wbr>options:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Scans for <code><a href="../Classes/Peripheral.html">Peripheral</a></code>s after subscription to returned observable. First parameter <code>serviceUUIDs</code> is
an array of <code><a href="../Classes/Service.html">Service</a></code> UUIDs which needs to be implemented by a peripheral to be discovered. If user don&rsquo;t want to
filter any peripherals, <code>nil</code> can be used instead. Additionally dictionary of
<a href="https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBCentralManager_Class/#//apple_ref/doc/constant_group/Peripheral_Scanning_Options">CBCentralManager specific options</a>
can be passed to allow further customisation.
Scans by default are infinite streams of <code><a href="../Classes/ScannedPeripheral.html">ScannedPeripheral</a></code> structures which need to be stopped by the user. For
example this can be done by limiting scanning to certain number of peripherals or time:</p>
<pre class="highlight swift"><code><span class="n">centralManager</span><span class="o">.</span><span class="nf">scanForPeripherals</span><span class="p">(</span><span class="nv">withServices</span><span class="p">:</span> <span class="kc">nil</span><span class="p">)</span>
    <span class="o">.</span><span class="nf">timeout</span><span class="p">(</span><span class="mf">3.0</span><span class="p">,</span> <span class="n">timeoutScheduler</span><span class="p">)</span>
    <span class="o">.</span><span class="nf">take</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
</code></pre>

<p>There can be only one ongoing scanning. It will return <code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO14scanInProgressyA2CmF">BluetoothError.scanInProgress</a></code> error if
this method will be called when there is already ongoing scan.
As a result you will receive <code><a href="../Classes/ScannedPeripheral.html">ScannedPeripheral</a></code> which contains <code><a href="../Classes/Peripheral.html">Peripheral</a></code> object, <code><a href="../Structs/AdvertisementData.html">AdvertisementData</a></code> and
peripheral&rsquo;s RSSI registered during discovery. You can then <code><a href="../Classes/CentralManager.html#/s:14RxBluetoothKit14CentralManagerC19establishConnection_7options0A5Swift10ObservableCyAA10PeripheralCGAJ_SDySSypGSgtF">establishConnection(_:options:)</a></code> and do other
operations.</p>
<div class="aside aside-seealso">
    <p class="aside-title">Seealso</p>
    <p><code><a href="../Classes/Peripheral.html">Peripheral</a></code></p>

</div>

<p>Observable can ends with following errors:</p>

<ul>
<li><code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO14scanInProgressyA2CmF">BluetoothError.scanInProgress</a></code></li>
<li><code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO9destroyedyA2CmF">BluetoothError.destroyed</a></code></li>
<li><code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO20bluetoothUnsupportedyA2CmF">BluetoothError.bluetoothUnsupported</a></code></li>
<li><code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO21bluetoothUnauthorizedyA2CmF">BluetoothError.bluetoothUnauthorized</a></code></li>
<li><code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO19bluetoothPoweredOffyA2CmF">BluetoothError.bluetoothPoweredOff</a></code></li>
<li><code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO23bluetoothInUnknownStateyA2CmF">BluetoothError.bluetoothInUnknownState</a></code></li>
<li><code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO18bluetoothResettingyA2CmF">BluetoothError.bluetoothResetting</a></code></li>
</ul>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">scanForPeripherals</span><span class="p">(</span><span class="n">withServices</span> <span class="nv">serviceUUIDs</span><span class="p">:</span> <span class="p">[</span><span class="kt">CBUUID</span><span class="p">]?,</span> <span class="nv">options</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span><span class="p">:</span> <span class="kt">Any</span><span class="p">]?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span>
                <span class="o">-&gt;</span> <span class="kt">Observable</span><span class="o">&lt;</span><span class="kt"><a href="../Classes/ScannedPeripheral.html">ScannedPeripheral</a></span><span class="o">&gt;</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>serviceUUIDs</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Services of peripherals to search for. Nil value will accept all peripherals.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>options</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Optional scanning options.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>Infinite stream of scanned peripherals.</p>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/Polidea/RxBluetoothKit/tree/6.0.0/Source/CentralManager.swift#L149-L189">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Peripheral%27s%20Connection%20Management"></a>
                <a name="//apple_ref/swift/Section/Peripheral&#39;s Connection Management" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Peripheral%27s%20Connection%20Management"></a>
                  <h3 class="section-name"><p>Peripheral&rsquo;s Connection Management</p>
</h3>
                </div>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14RxBluetoothKit14CentralManagerC19establishConnection_7options0A5Swift10ObservableCyAA10PeripheralCGAJ_SDySSypGSgtF"></a>
                    <a name="//apple_ref/swift/Method/establishConnection(_:options:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:14RxBluetoothKit14CentralManagerC19establishConnection_7options0A5Swift10ObservableCyAA10PeripheralCGAJ_SDySSypGSgtF">establishConnection(_:<wbr>options:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Establishes connection with a given <code><a href="../Classes/Peripheral.html">Peripheral</a></code>.
When connection did succeded it sends event with <code><a href="../Classes/Peripheral.html">Peripheral</a></code> - from now on it is possible to call all other methods that require connection.
The connection is automatically disconnected when resulting Observable is unsubscribed.
On the other hand when the connection is interrupted or failed by the device or the system, the Observable will be unsubscribed as well
following <code>BluetoothError.peripheralConnectionFailed</code> or <code>BluetoothError.peripheralDisconnected</code> emission.
Additionally you can pass optional <a href="https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBCentralManager_Class/#//apple_ref/doc/constant_group/Peripheral_Connection_Options">dictionary</a>
to customise the behaviour of connection.</p>

<p>Observable can ends with following errors:</p>

<ul>
<li><code>BluetoothError.peripheralIsAlreadyObservingConnection</code></li>
<li><code>BluetoothError.peripheralConnectionFailed</code></li>
<li><code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO9destroyedyA2CmF">BluetoothError.destroyed</a></code></li>
<li><code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO20bluetoothUnsupportedyA2CmF">BluetoothError.bluetoothUnsupported</a></code></li>
<li><code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO21bluetoothUnauthorizedyA2CmF">BluetoothError.bluetoothUnauthorized</a></code></li>
<li><code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO19bluetoothPoweredOffyA2CmF">BluetoothError.bluetoothPoweredOff</a></code></li>
<li><code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO23bluetoothInUnknownStateyA2CmF">BluetoothError.bluetoothInUnknownState</a></code></li>
<li><code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO18bluetoothResettingyA2CmF">BluetoothError.bluetoothResetting</a></code></li>
</ul>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">establishConnection</span><span class="p">(</span><span class="n">_</span> <span class="nv">peripheral</span><span class="p">:</span> <span class="kt"><a href="../Classes/Peripheral.html">Peripheral</a></span><span class="p">,</span> <span class="nv">options</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span> <span class="p">:</span> <span class="kt">Any</span><span class="p">]?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Observable</span><span class="o">&lt;</span><span class="kt"><a href="../Classes/Peripheral.html">Peripheral</a></span><span class="o">&gt;</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>peripheral</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>The <code><a href="../Classes/Peripheral.html">Peripheral</a></code> to which <code>CentralManager</code> is attempting to establish connection.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>options</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Dictionary to customise the behaviour of connection.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p><code>Observable</code> which emits next event after connection is established.</p>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/Polidea/RxBluetoothKit/tree/6.0.0/Source/CentralManager.swift#L214-L217">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Retrieving%20Lists%20of%20Peripherals"></a>
                <a name="//apple_ref/swift/Section/Retrieving Lists of Peripherals" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Retrieving%20Lists%20of%20Peripherals"></a>
                  <h3 class="section-name"><p>Retrieving Lists of Peripherals</p>
</h3>
                </div>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14RxBluetoothKit14CentralManagerC28retrieveConnectedPeripherals12withServicesSayAA10PeripheralCGSaySo6CBUUIDCG_tF"></a>
                    <a name="//apple_ref/swift/Method/retrieveConnectedPeripherals(withServices:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:14RxBluetoothKit14CentralManagerC28retrieveConnectedPeripherals12withServicesSayAA10PeripheralCGSaySo6CBUUIDCG_tF">retrieveConnectedPeripherals(withServices:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns list of the <code><a href="../Classes/Peripheral.html">Peripheral</a></code>s which are currently connected to the <code>CentralManager</code> and contain
all of the specified <code><a href="../Classes/Service.html">Service</a></code>&lsquo;s UUIDs.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">retrieveConnectedPeripherals</span><span class="p">(</span><span class="n">withServices</span> <span class="nv">serviceUUIDs</span><span class="p">:</span> <span class="p">[</span><span class="kt">CBUUID</span><span class="p">])</span> <span class="o">-&gt;</span> <span class="p">[</span><span class="kt"><a href="../Classes/Peripheral.html">Peripheral</a></span><span class="p">]</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>serviceUUIDs</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>A list of <code><a href="../Classes/Service.html">Service</a></code> UUIDs</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>Retrieved <code><a href="../Classes/Peripheral.html">Peripheral</a></code>s. They are in connected state and contain all of the
<code><a href="../Classes/Service.html">Service</a></code>s with UUIDs specified in the <code>serviceUUIDs</code> parameter.</p>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/Polidea/RxBluetoothKit/tree/6.0.0/Source/CentralManager.swift#L227-L230">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14RxBluetoothKit14CentralManagerC19retrievePeripherals15withIdentifiersSayAA10PeripheralCGSay10Foundation4UUIDVG_tF"></a>
                    <a name="//apple_ref/swift/Method/retrievePeripherals(withIdentifiers:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:14RxBluetoothKit14CentralManagerC19retrievePeripherals15withIdentifiersSayAA10PeripheralCGSay10Foundation4UUIDVG_tF">retrievePeripherals(withIdentifiers:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Returns list of <code><a href="../Classes/Peripheral.html">Peripheral</a></code>s by their identifiers which are known to <code>CentralManager</code>.</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">retrievePeripherals</span><span class="p">(</span><span class="n">withIdentifiers</span> <span class="nv">identifiers</span><span class="p">:</span> <span class="p">[</span><span class="kt">UUID</span><span class="p">])</span> <span class="o">-&gt;</span> <span class="p">[</span><span class="kt"><a href="../Classes/Peripheral.html">Peripheral</a></span><span class="p">]</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>identifiers</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>List of <code><a href="../Classes/Peripheral.html">Peripheral</a></code>&lsquo;s identifiers which should be retrieved.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>Retrieved <code><a href="../Classes/Peripheral.html">Peripheral</a></code>s.</p>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/Polidea/RxBluetoothKit/tree/6.0.0/Source/CentralManager.swift#L236-L239">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/Connection%20and%20disconnection%20observing"></a>
                <a name="//apple_ref/swift/Section/Connection and disconnection observing" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/Connection%20and%20disconnection%20observing"></a>
                  <h3 class="section-name"><p>Connection and disconnection observing</p>
</h3>
                </div>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14RxBluetoothKit14CentralManagerC14observeConnect3for0A5Swift10ObservableCyAA10PeripheralCGAJSg_tF"></a>
                    <a name="//apple_ref/swift/Method/observeConnect(for:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:14RxBluetoothKit14CentralManagerC14observeConnect3for0A5Swift10ObservableCyAA10PeripheralCGAJSg_tF">observeConnect(for:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Emits <code><a href="../Classes/Peripheral.html">Peripheral</a></code> instance when it&rsquo;s connected.</p>

<p>It&rsquo;s <strong>infinite</strong> stream, so <code>.complete</code> is never called.</p>

<p>Observable can ends with following errors:</p>

<ul>
<li><code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO9destroyedyA2CmF">BluetoothError.destroyed</a></code></li>
<li><code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO20bluetoothUnsupportedyA2CmF">BluetoothError.bluetoothUnsupported</a></code></li>
<li><code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO21bluetoothUnauthorizedyA2CmF">BluetoothError.bluetoothUnauthorized</a></code></li>
<li><code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO19bluetoothPoweredOffyA2CmF">BluetoothError.bluetoothPoweredOff</a></code></li>
<li><code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO23bluetoothInUnknownStateyA2CmF">BluetoothError.bluetoothInUnknownState</a></code></li>
<li><code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO18bluetoothResettingyA2CmF">BluetoothError.bluetoothResetting</a></code></li>
</ul>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">observeConnect</span><span class="p">(</span><span class="k">for</span> <span class="nv">peripheral</span><span class="p">:</span> <span class="kt"><a href="../Classes/Peripheral.html">Peripheral</a></span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Observable</span><span class="o">&lt;</span><span class="kt"><a href="../Classes/Peripheral.html">Peripheral</a></span><span class="o">&gt;</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>peripheral</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Optional <code><a href="../Classes/Peripheral.html">Peripheral</a></code> which is observed for connection. When not specified it will observe fo any <code><a href="../Classes/Peripheral.html">Peripheral</a></code>.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>Observable which emits next events when <code>peripheral</code> was connected.</p>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/Polidea/RxBluetoothKit/tree/6.0.0/Source/CentralManager.swift#L257-L265">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14RxBluetoothKit14CentralManagerC17observeDisconnect3for0A5Swift10ObservableCyAA10PeripheralC_s5Error_pSgtGAJSg_tF"></a>
                    <a name="//apple_ref/swift/Method/observeDisconnect(for:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:14RxBluetoothKit14CentralManagerC17observeDisconnect3for0A5Swift10ObservableCyAA10PeripheralC_s5Error_pSgtGAJSg_tF">observeDisconnect(for:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Emits <code><a href="../Classes/Peripheral.html">Peripheral</a></code> instance when it&rsquo;s disconnected.</p>

<p>It&rsquo;s <strong>infinite</strong> stream, so <code>.complete</code> is never called.</p>

<p>Observable can ends with following errors:</p>

<ul>
<li><code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO9destroyedyA2CmF">BluetoothError.destroyed</a></code></li>
<li><code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO20bluetoothUnsupportedyA2CmF">BluetoothError.bluetoothUnsupported</a></code></li>
<li><code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO21bluetoothUnauthorizedyA2CmF">BluetoothError.bluetoothUnauthorized</a></code></li>
<li><code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO19bluetoothPoweredOffyA2CmF">BluetoothError.bluetoothPoweredOff</a></code></li>
<li><code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO23bluetoothInUnknownStateyA2CmF">BluetoothError.bluetoothInUnknownState</a></code></li>
<li><code><a href="../Enums/BluetoothError.html#/s:14RxBluetoothKit0B5ErrorO18bluetoothResettingyA2CmF">BluetoothError.bluetoothResetting</a></code></li>
</ul>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">observeDisconnect</span><span class="p">(</span><span class="k">for</span> <span class="nv">peripheral</span><span class="p">:</span> <span class="kt"><a href="../Classes/Peripheral.html">Peripheral</a></span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Observable</span><span class="o">&lt;</span><span class="p">(</span><span class="kt"><a href="../Classes/Peripheral.html">Peripheral</a></span><span class="p">,</span> <span class="kt"><a href="../Typealiases.html#/s:14RxBluetoothKit19DisconnectionReasona">DisconnectionReason</a></span><span class="p">?)</span><span class="o">&gt;</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>peripheral</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Optional <code><a href="../Classes/Peripheral.html">Peripheral</a></code> which is observed for disconnection. When not specified it will observe for any <code><a href="../Classes/Peripheral.html">Peripheral</a></code>.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div>
                        <h4>Return Value</h4>
                        <p>Observable which emits next events when <code><a href="../Classes/Peripheral.html">Peripheral</a></code> instance was disconnected.
It provides optional error which may contain more information about the cause of the disconnection
if it wasn&rsquo;t the <code>cancelPeripheralConnection</code> call.</p>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/Polidea/RxBluetoothKit/tree/6.0.0/Source/CentralManager.swift#L282-L298">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/ANCS"></a>
                <a name="//apple_ref/swift/Section/ANCS" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/ANCS"></a>
                  <h3 class="section-name"><p>ANCS</p>
</h3>
                </div>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14RxBluetoothKit14CentralManagerC21observeANCSAuthorized3for0A5Swift10ObservableCySbGAA10PeripheralC_tF"></a>
                    <a name="//apple_ref/swift/Method/observeANCSAuthorized(for:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:14RxBluetoothKit14CentralManagerC21observeANCSAuthorized3for0A5Swift10ObservableCySbGAA10PeripheralC_tF">observeANCSAuthorized(for:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Undocumented</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">func</span> <span class="nf">observeANCSAuthorized</span><span class="p">(</span><span class="k">for</span> <span class="nv">peripheral</span><span class="p">:</span> <span class="kt"><a href="../Classes/Peripheral.html">Peripheral</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Observable</span><span class="o">&lt;</span><span class="kt">Bool</span><span class="o">&gt;</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/Polidea/RxBluetoothKit/tree/6.0.0/Source/CentralManager.swift#L308-L318">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
            <div class="task-group">
              <div class="task-name-container">
                <a name="/State%20restoration"></a>
                <a name="//apple_ref/swift/Section/State restoration" class="dashAnchor"></a>
                <div class="section-name-container">
                  <a class="section-name-link" href="#/State%20restoration"></a>
                  <h3 class="section-name"><p>State restoration</p>
</h3>
                </div>
              </div>
              <ul>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14RxBluetoothKit14CentralManagerC5queue7options18onWillRestoreStateACSo012OS_dispatch_F0C_SDySSyXlGSgyAA08RestoredK0VcSgtcfc"></a>
                    <a name="//apple_ref/swift/Method/init(queue:options:onWillRestoreState:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:14RxBluetoothKit14CentralManagerC5queue7options18onWillRestoreStateACSo012OS_dispatch_F0C_SDySSyXlGSgyAA08RestoredK0VcSgtcfc">init(queue:<wbr>options:<wbr>onWillRestoreState:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Deprecated, use CentralManager.init(queue:options:onWillRestoreCentralManagerState:) instead</p>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">@available(*, deprecated, renamed: "CentralManager.init(queue:options:onWillRestoreCentralManagerState:﹚")</span>
<span class="kd">public</span> <span class="n">convenience</span> <span class="nf">init</span><span class="p">(</span><span class="nv">queue</span><span class="p">:</span> <span class="kt">DispatchQueue</span> <span class="o">=</span> <span class="o">.</span><span class="n">main</span><span class="p">,</span>
                        <span class="nv">options</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span><span class="p">:</span> <span class="kt">AnyObject</span><span class="p">]?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
                        <span class="nv">onWillRestoreState</span><span class="p">:</span> <span class="kt"><a href="../Typealiases.html#/s:14RxBluetoothKit18OnWillRestoreStatea">OnWillRestoreState</a></span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/Polidea/RxBluetoothKit/tree/6.0.0/Source/CentralManager+RestoredState.swift#L16-L23">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
                <li class="item">
                  <div>
                    <code>
                    <a name="/s:14RxBluetoothKit14CentralManagerC5queue7options013onWillRestoredE5StateACSo012OS_dispatch_F0C_SDySSyXlGSgyAA0de8RestoredK0VcSgtcfc"></a>
                    <a name="//apple_ref/swift/Method/init(queue:options:onWillRestoreCentralManagerState:)" class="dashAnchor"></a>
                    <a class="token" href="#/s:14RxBluetoothKit14CentralManagerC5queue7options013onWillRestoredE5StateACSo012OS_dispatch_F0C_SDySSyXlGSgyAA0de8RestoredK0VcSgtcfc">init(queue:<wbr>options:<wbr>onWillRestoreCentralManagerState:<wbr>)</a>
                    </code>
                  </div>
                  <div class="height-container">
                    <div class="pointer-container"></div>
                    <section class="section">
                      <div class="pointer"></div>
                      <div class="abstract">
                        <p>Creates new <code>CentralManager</code> instance, which supports bluetooth state restoration.</p>
<div class="aside aside-warning">
    <p class="aside-title">Warning</p>
    If you pass background queue to the method make sure to observe results on main thread
for UI related code.

</div><div class="aside aside-seealso">
    <p class="aside-title">Seealso</p>
    <p><code><a href="../Typealiases.html#/s:14RxBluetoothKit32OnWillRestoreCentralManagerStatea">OnWillRestoreCentralManagerState</a></code></p>

</div>

                      </div>
                      <div class="declaration">
                        <h4>Declaration</h4>
                        <div class="language">
                          <p class="aside-title">Swift</p>
                          <pre class="highlight swift"><code><span class="kd">public</span> <span class="n">convenience</span> <span class="nf">init</span><span class="p">(</span><span class="nv">queue</span><span class="p">:</span> <span class="kt">DispatchQueue</span> <span class="o">=</span> <span class="o">.</span><span class="n">main</span><span class="p">,</span>
                        <span class="nv">options</span><span class="p">:</span> <span class="p">[</span><span class="kt">String</span><span class="p">:</span> <span class="kt">AnyObject</span><span class="p">]?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">,</span>
                        <span class="nv">onWillRestoreCentralManagerState</span><span class="p">:</span> <span class="kt"><a href="../Typealiases.html#/s:14RxBluetoothKit32OnWillRestoreCentralManagerStatea">OnWillRestoreCentralManagerState</a></span><span class="p">?</span> <span class="o">=</span> <span class="kc">nil</span><span class="p">)</span></code></pre>

                        </div>
                      </div>
                      <div>
                        <h4>Parameters</h4>
                        <table class="graybox">
                          <tbody>
                            <tr>
                              <td>
                                <code>
                                <em>queue</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Queue on which bluetooth callbacks are received. By default main thread is used
and all operations and events are executed and received on main thread.</p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>options</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>An optional dictionary containing initialization options for a central manager.
For more info about it please refer to <a href="https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBCentralManager_Class/index.html">Central Manager initialization options</a></p>
                                </div>
                              </td>
                            </tr>
                            <tr>
                              <td>
                                <code>
                                <em>onWillRestoreCentralManagerState</em>
                                </code>
                              </td>
                              <td>
                                <div>
                                  <p>Closure called when state has been restored.</p>
                                </div>
                              </td>
                            </tr>
                          </tbody>
                        </table>
                      </div>
                      <div class="slightly-smaller">
                        <a href="https://github.com/Polidea/RxBluetoothKit/tree/6.0.0/Source/CentralManager+RestoredState.swift#L35-L42">Show on GitHub</a>
                      </div>
                    </section>
                  </div>
                </li>
              </ul>
            </div>
          </section>
        </section>
        <section id="footer">
          <p>&copy; 2020 <a class="link" href="https://polidea.com" target="_blank" rel="external">Polidea</a>. All rights reserved. (Last updated: 2020-09-04)</p>
          <p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.13.5</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
        </section>
      </article>
    </div>
  </body>
</div>
</html>
